use chrono::{Local, NaiveDateTime, TimeZone};

pub fn current_time_slice() {
    let now = Local::now();
    let today_start = Local::today().and_hms(0, 0, 0);
    println!("{}", now);
    println!("{}", today_start);
    println!("current time slice is {}", (now.timestamp() - today_start.timestamp()) / 60 / 10);
}

pub fn from_millis() {
    let ms = "1629432310000";
    let dt = Local.timestamp(ms[..10].parse::<i64>().unwrap(), 0).naive_local();
    println!("{}", dt);
}